<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="format-detection" content="telephone=no"/>
    <meta content="email=no" name="format-detection"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>观看页面</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/public.css">
</head>

<body>
<!-- 头部 -->
<div class="header flex">
    <a href="#" class="c_btn">
        <img src="__PUBLIC__/Home/img/genduo.png" alt="">
    </a>
    <form action="">
        <input type="text">
        <input type="submit" value="">
    </form>
    <a href="{:U('info')}" class="user">
        <img src="__PUBLIC__/Home/img/hyzx.png" alt="">
    </a>
</div>
<!-- 中部 -->
<div class="gk_main">
    <?php if($viptime[viptime]>time()):?>

    <div class="video_box">
        <video id="vbox" controlslist="nodownload" controls="controls" src="<?php echo $zydata['url']?>"
               controls="controls">
            your browser does not support the video tag
        </video>
        <div class="video_title"><?php echo $zydata['name']?></div>
        <div class="video_explain">
            <strong>7.7分</strong>
            <span><?php echo $zydata['cs']?>次播放</span>
        </div>
    </div>
    <?php else :?>
    <img id="code" src="__PUBLIC__/Home/img/vdo.jpg" style="width: 100%"/>
    <?php endif;?>
    <div class="more">
        <h2>更多推荐</h2>
        <ul>
            <foreach name="sptj" item="v">
                <li>
                    <a href="javacript:void(0)" onclick="changge(this)" url="{$v['url']}">
                        <?php showImage($v['bigpic'],375,200);?>
                        <img src="__PUBLIC__/Home/img/play.png" class="playbtn">
                    </a>
                    <p>{:$v['name']}</p>
                </li>
            </foreach>
        </ul>
    </div>
</div>
<!-- 遮罩层 -->
<div class="mask"></div>
<!-- 侧边栏 -->
<div class="sidebar">
    <ul>
        <li>用户：{:session('member_name')}</li>
        <li>
            <p>频道</p>

            <div class="child_list_1 flex">
                <foreach name="data" item="v">
                    <a href="{:U('index')}">{$v['name']}</a>
                </foreach>
            </div>
            <!--<div class="child_list_1 flex">
                <a href="#">动漫</a>
                <a href="#">综艺</a>
                <a href="#">资讯</a>
            </div>
            <div class="child_list_1 flex">
                <a href="#">电影</a>
                <a href="#">电视剧</a>
                <a href="#">体育</a>
            </div>-->
        </li>
        <li>
            <p>观看记录</p>
            <?php foreach($history as $v):?>
            <div class="child_list_2">
                <a onclick="changge(this)" class="flex" url="<?php echo $v['url'];?>">
                    <?php showImage($v['smallpic'],135,75);?>
                    <div>
                        <p><?php echo $v['name']?></p>
                        <p>已观看</p>
                    </div>
                </a>
            </div>
            <?php endforeach;?>
        </li>
    </ul>
</div>
</body>

</html>
<script src="__PUBLIC__/Home/js/jquery-1.12.4.min.js"></script>
<script src="__PUBLIC__/Home/js/common.js"></script>
<script>
    $(function () {
        $('.c_btn').click(function () {
            $('.mask').fadeIn();
            $('.sidebar').animate({left: '0px'}, 300)
        });
        $('.mask').click(function () {
            $(this).fadeOut();
            $('.sidebar').animate({left: '-100%'}, 300)
        })
        var url = "{:$zydata['url']}";
        var name = "{:$zydata['name']}";
        var id = "{:session('uid')}";
        var spid = "{:$zydata['id']}";
        $.post('{:U(history)}', {url: url, name: name, uid: id, spid: spid}, function (res) {

        })

    })

    function changge(obj) {
        var url = $(obj).attr('url');
        $("#vbox").attr("src", url);//直接播放
        $("#vbox").attr("autoplay", "true");//直接播放

    }

    $('#code').click(function () {
        if (confirm('会员已到期，是否续费?')) {
            location.href = "<?php echo U('recharge')?>";
        } else if (confirm('既然取消了，那就打赏呗?')) {
            location.href = "{:U('das')}";//跳转到打赏页面
        }
    })


</script>